<?php
class feedback extends SClass {
    
    public function process() {
        $emailto = "admin@stu.cn.ua";

        $subject = "Відгук";
/*        try {
           
                MailUtils_Letter::__construct( $this->getControlValue('emailfrom'),
                                                $this->$emailto,
                                                 $this->$subject, 
                                                $this->getControlValue('content')
                                               )->send();
                $this->assign('message', 'ok');
            }
        } catch (ServiceUtils_Exception $e) {
            $this->assign('errors', $e->getErrors());
        }
        */
        if ($this->getControlValue('ok')) { 
            try{ mail( $emailto, $subject, $this->getControlValue('content'),"From:".$this->getControlValue('emailfrom'), null);
            $this->assign('message', 'ok');
            }
             
            catch(ServiceUtils_Exception $e) { $this->assign('errors', $e->getErrors());}
        }
    }

}